package com.yueyang.sojourn.server.common.baymax.web.resolver;

/**
 * 响应给客户端的Message，包括Http状态码，业务码，业务码说明
 */
public final class RestResponseMessage {
  /**
   * 业务码
   */
  private int code;
  /**
   * 业务信息
   */
  private String message;
  /**
   * http状态码
   */
  private int httpStatus;
  
  /**
   * 请求是否发送成功
   */
  private boolean requestSucceeded=true;

  public RestResponseMessage(int code, String message) {
    super();
    this.code = code;
    this.message = message;
  }

  public RestResponseMessage(int code, String message, int httpStatus) {
    super();
    this.code = code;
    this.message = message;
    this.httpStatus = httpStatus;
  }

  



  /**
   * @return 请求是否发送成功
   */
  public boolean isRequestSucceeded() {
    return this.requestSucceeded;
  }



  /**
   * 设置 请求是否发送成功
   * @param boolean to set
   */
  public void setRequestSucceeded(boolean requestSucceeded) {
    this.requestSucceeded = requestSucceeded;
  }



  /**
   * 业务码
   * 
   * @return the code
   */
  public int getCode() {
    return code;
  }

  /**
   * 业务信息
   * 
   * @return the message
   */
  public String getMessage() {
    return message;
  }

  /**
   * http状态码
   * 
   * @return the httpStatus
   */
  public int getHttpStatus() {
    return httpStatus;
  }



  /* 
   * @see java.lang.Object#toString()
   */
  @Override
  public String toString() {
    return "RestResponseMessage [code=" + code + ", message=" + message + ", httpStatus=" + httpStatus + ", requestSucceeded="
        + requestSucceeded + "]";
  }




}
